package collatz;

public class DefaultCollatz{
	private int iterations;

	public DefaultCollatz(){
		
	}
	public boolean collatz(long number) {
		return comput(number);
	}
	
	public int  numIterations(){
		return iterations;
	}
		

	private boolean comput(long number) {
		iterations = 0;
		while (number > 1) {

			if (number % 2 == 0)
				number /= 2;
			else
				number = number * 3 + 1;

			iterations += 1;
		}

		if (number == 1) {
			return true;
		} else {
			return false;
		}

	}

}
